import request from '@utils/request'

// 查询院系信息
export function getCollegeList (data) {
  return request({
    url: '/college/getPageList',
    method: 'post',
    data: data,
    headers: {
      'Content-Type': 'application/json',
      'Authorization': window.localStorage.getItem('token'),
    }
  })
}

// 获取学院名称
export function getCollegeName (data) {
  return request({
    url: '/college/getCollegeList',
    method: 'post',
    data: data,
    headers: {
      'Content-Type': 'application/x-www-form-urlencoded',
      'Authorization': window.localStorage.getItem('token'),
    }
  })
}

// 新增院系
export function addCollege (data) {
  return request({
    url: '/college/save',
    method: 'post',
    data: data,
    headers: {
      'Content-Type': 'application/json',
      'Authorization': window.localStorage.getItem('token'),
    }
  })
}

// 修改院系
export function updateCollege (data) {
  return request({
    url: '/college/update',
    method: 'post',
    data: data,
    headers: {
      'Content-Type': 'application/json',
      'Authorization': window.localStorage.getItem('token'),
    }
  })
}

// 删除院系
export function deleteCollege (data) {
  return request({
    url: '/college/delete',
    method: 'post',
    data: data,
    headers: {
      'Content-Type': 'application/x-www-form-urlencoded',
      'Authorization': window.localStorage.getItem('token'),
    }
  })
}

// 获取辅导员
export function getTeacher (data) {
  return request({
    url: '/gradeInformation/getTeaList',
    method: 'get',
    params: data,
    headers: {
      'Content-Type': 'application/x-www-form-urlencoded',
      'Authorization': window.localStorage.getItem('token'),
    }
  })
}